package cn.minimelon.api.controller.data;

import cn.minimelon.api.domain.common.AjaxResult;
import cn.minimelon.api.domain.data.ModelQueryVO;
import cn.minimelon.api.domain.module.vo.ModelFullVO;
import cn.minimelon.api.service.data.ModelDeployService;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.core.handle.MethodType;

/**
 * 发布模型查询接口
 */
@Controller
@Mapping("/data")
public class ModelDeployController {
    @Inject
    private ModelDeployService modelDeployService;

    /**
     * 根据模型编码获取完全信息
     */
    @Mapping(value = "/{area}/{code}/deploy/full", method = MethodType.POST)
    public AjaxResult queryFullInfo(String area, String code) {
        ModelQueryVO query = new ModelQueryVO();
        query.setAreaCode(area);
        query.setModelCode(code);
        ModelFullVO fullInfo = modelDeployService.selectFullInfo(query);
        return AjaxResult.success(fullInfo);
    }
}
